#LOCAL_PATH is used to locate source files in the development tree.
#the macro my-dir provided by the build system, indicates the path of the current directory
LOCAL_PATH:=$(call my-dir)
 
#####################################################################
#            build libnfnetlink                    #
#####################################################################
include $(CLEAR_VARS)
LOCAL_MODULE:=libnfnetlink
LOCAL_C_INCLUDES := $(LOCAL_PATH)/libnfnetlink/include
LOCAL_SRC_FILES:=\
    libnfnetlink/src/iftable.c \
    libnfnetlink/src/rtnl.c \
    libnfnetlink/src/libnfnetlink.c
include $(BUILD_STATIC_LIBRARY)
#include $(BUILD_SHARED_LIBRARY)
 
#####################################################################
#            build libnetfilter_log            #
#####################################################################
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/libnfnetlink/include \
    $(LOCAL_PATH)/libnetfilter_log/include
LOCAL_MODULE:=libnetfilter_log
LOCAL_SRC_FILES:=\
    libnetfilter_log/src/libnetfilter_log.c \
    libnetfilter_log/src/libipulog_compat.c
LOCAL_STATIC_LIBRARIES:=libnfnetlink
include $(BUILD_STATIC_LIBRARY)
#include $(BUILD_SHARED_LIBRARY)
 
#####################################################################
#            build our code                    #
#####################################################################
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/libnfnetlink/include \
    $(LOCAL_PATH)/libnetfilter_log/include \
    $(JNI_H_INCLUDE)
LOCAL_MODULE:=connTracker
LOCAL_SRC_FILES:=connTracker.c
LOCAL_STATIC_LIBRARIES:=libnetfilter_log
LOCAL_LDLIBS:=-llog -lm
#include $(BUILD_SHARED_LIBRARY)
#include $(BUILD_STATIC_LIBRARY)
include $(BUILD_EXECUTABLE)

